import Relay from "react-relay";

export default class InfoEnquiryOrderMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { infoEnquiryOrder }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId: this.props.orderId,
                enId :this.props.enId,
                enquiryId: this.props.enquiryId
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on infoEnquiryOrderPayload {
            infoEnquiryOrder {
              token
              userId
              value
              errorCode
              totalResult
              authorityId
              order{
                parentOrder{
                    partBName
                    partAName
                    account
                } 
                makeType
                isValid
                enquiryId
                oid
                enId
                partAPhone
                profitAccount
                orderType
                rmark
                partBUserId
                traderName
                traderUser
                traderId
                traderPhone
                traderUrl1
                traderUrl2
                partBName
                traderUrl3
                traderUrl4
                partBUserName
                traderUrl5
                createDate
                partBPhone
                partAUserName
                deliverRequest
                uid
                requirement
                purchaseAccount
                deliverRequests{
                  deliverDate
                  remark
                  did
                  createDate
                  amount
                  orderId
                }
                parentId
                token
                payAccount
                partAName
                orderGoodsNum
                orderGoodss{
                 poNumber
                datamatching
                sailingDate
                size
                description
                  productName
                  orderId
                  purpose
                  gid
                  yarnState
                  createDate
                  price
                  constituent
                  cylinderhead
                  url
                  yarnTypes
                  consumption
                  specification
                  styleNo
                  sendQuantity
                  checkQuantity
                  quantity
                  amount
                  yarn
                  bigGoodsQua
                  acceptQuantity
                  gramWeight
                  larghezza
                  colour
                  prickle
                  desp
                  fabricWeave
                  density
                }
                orderOperates{
                  money
                  fromUserName
                  cid
                  createDate
                  status
                  operaterType
                  toUserName
                  toUserPhone
                  fromUserId
                  orderId
                  operater
                  quantity
                  actualMoney
                  toId
                  fromId
                  toUserId
                  fromUserPhone
                  description
                }
                supplyContracts{
                  contractUr4
                  supplyAccount
                  contractUr3
                  contractUr5
                  sid
                  contractUr2
                  orderId
                  createDate
                  status
                  account
                  operateDate
                  contractUrl
                  desp
                }
                createUser
                contractId
                account
                contractUrl1
                goodsInfo
                status
                contractUrl2
                partAUserId
                contractUrl3
                contractUrl4
                contractUrl5
                partBAddress
                partA
                partB
                partAAddress
                phone
                signedContract
                signedContractUrl5
                signedContractUrl4
                signedContractUrl3
                signedContractUrl2
                signedContractUrl1
                signedDate
                contractUrlId1
                contractUrlId2
                contractUrlId3
                contractUrlId4
                contractUrlId5
                orderOthers{
                  qualityAsk
                  packageAsk
                  logisticsAsk
                  payMode
                  dutyBreak
                  checkAsk
                  remarks
                  appendixUrl
                }
              }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on infoEnquiryOrderPayload {
                  infoEnquiryOrder {
                    token
                    userId
                    value
                    errorCode
                    totalResult
                    authorityId
                    order{
                      parentOrder{
                           partBName
                           partAName
                           account
                       } 
                       makeType
                      isValid
                      enquiryId
                      oid
                      enId
                      partAPhone
                      profitAccount
                      orderType
                      rmark
                      partBUserId
                      traderName
                      traderUser
                      traderId
                      traderPhone
                      traderUrl1
                      traderUrl2
                      partBName
                      traderUrl3
                      traderUrl4
                      partBUserName
                      traderUrl5
                      createDate
                      partBPhone
                      partAUserName
                      deliverRequest
                      uid
                      requirement
                      purchaseAccount
                      deliverRequests{
                        deliverDate
                        remark
                        did
                        createDate
                        amount
                        orderId
                      }
                      parentId
                      token
                      payAccount
                      partAName
                      orderGoodsNum
                      orderGoodss{
                        poNumber
                        datamatching
                        sailingDate
                        size
                        description
                        productName
                        orderId
                        purpose
                        gid
                        yarnState
                        createDate
                        price
                        constituent
                        cylinderhead
                        url
                        yarnTypes
                        consumption
                        specification
                        styleNo
                        sendQuantity
                        checkQuantity
                        quantity
                        amount
                        yarn
                        bigGoodsQua
                        acceptQuantity
                        gramWeight
                        larghezza
                        colour
                        prickle
                        desp
                        fabricWeave
                        density
                      }
                      orderOperates{
                        money
                        fromUserName
                        cid
                        createDate
                        status
                        operaterType
                        toUserName
                        toUserPhone
                        fromUserId
                        orderId
                        operater
                        quantity
                        actualMoney
                        toId
                        fromId
                        toUserId
                        fromUserPhone
                        description
                      }
                      supplyContracts{
                        contractUr4
                        supplyAccount
                        contractUr3
                        contractUr5
                        sid
                        contractUr2
                        orderId
                        createDate
                        status
                        account
                        operateDate
                        contractUrl
                        desp
                      }
                      createUser
                      contractId
                      account
                      contractUrl1
                      goodsInfo
                      status
                      contractUrl2
                      partAUserId
                      contractUrl3
                      contractUrl4
                      contractUrl5
                      partBAddress
                      partA
                      partB
                      partAAddress
                      phone
                      signedContract
                      signedContractUrl5
                      signedContractUrl4
                      signedContractUrl3
                      signedContractUrl2
                      signedContractUrl1
                      signedDate
                      contractUrlId1
                      contractUrlId2
                      contractUrlId3
                      contractUrlId4
                      contractUrlId5
                      orderOthers{
                        qualityAsk
                        packageAsk
                        logisticsAsk
                        payMode
                        dutyBreak
                        checkAsk
                        remarks
                        appendixUrl
                      }
                  }
                }
              }
            `]
        }];
    }

}
